# 2024/1/10 18:47 HFL
import logging
import os

from common.changefilename import fname1
a=os.path.split(os.getcwd())[0]
b=fname1('.log')
print(a,b)
path1=os.path.join(a,'logs',b)
print(path1)

logging.basicConfig(level=logging.DEBUG,
                    format='%(asctime)s %(levelname)s: %(message)s',
                    datefmt='%Y-%m-%d %H:%M:%S',
                    filename=path1,
                    filemode='a')

# 记录日志信息
logging.debug('debug message')
# logging.info('info message')
# logging.warning('warning message')
# logging.error('error message')
# logging.critical('critical message')